import { instance } from "../utils/request";
const getSuppliersPagination = async (params) => {
  return await instance.get("/Suppliers/Pagination", params);
};

const addSuppliers = async (formData) => {
  return await instance.upload("/Suppliers/Add", formData);
};

const updateSuppliers = async (formData) => {
  return await instance.upload("/Suppliers/Update", formData);
};

const getSuppliersDetail = async (id) => {
  return await instance.get("/Suppliers/Detail", { id: id });
};

const deleteSuppliers = async (id) => {
  return await instance.post("/Suppliers/Delete", { id: id });
};

const getOptionByShopName = async (shopName) => {
  return await instance.get("/Suppliers/GetOptionByShopName", { shopName });
};

const suppliersApi = {
  getSuppliersPagination,
  addSuppliers,
  updateSuppliers,
  getSuppliersDetail,
  deleteSuppliers,
  getOptionByShopName,
};

export default suppliersApi;
